import request from "@/utils/request";

// 查询学生信息列表
export function listStudent(query) {
  return request({
    url: "/stu/student/list",
    method: "get",
    params: query,
  });
}

// 查询学生信息详细
export function getStudent(studentId) {
  return request({
    url: "/stu/student/" + studentId,
    method: "get",
  });
}
// 状态修改
export function changeStatus(studentId, studentStatus) {
  const data = {
    studentId,
    studentStatus,
  };
  console.log(data);
  return request({
    url: "/stu/student/changeStatus",
    method: "put",
    data: data,
  });
}
// 新增学生信息
export function addStudent(data) {
  return request({
    url: "/stu/student",
    method: "post",
    data: data,
  });
}

// 修改学生信息
export function updateStudent(data) {
  return request({
    url: "/stu/student",
    method: "put",
    data: data,
  });
}

// 删除学生信息
export function delStudent(studentId) {
  return request({
    url: "/stu/student/" + studentId,
    method: "delete",
  });
}
